compute mean of a vector of real numbers. If nodata is passed numbers are filetered before computing mean